Feature/adjust rocksdb config by memory#9000
Merged
Conversation
benaadams
approved these changes
Jul 18, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request implements dynamic RocksDB configuration optimization based on available system memory and pruning mode. The changes enable automatic adjustment of database settings to improve performance when sufficient memory is available (>32GB) or when running in archive mode, reducing write amplification and increasing write buffer sizes.
Key changes include:
- Introduction of a
RocksDbConfigFactorythat dynamically adjusts database configurations based on hardware capabilities - Automatic optimization for high-memory systems (>32GB) and archive mode configurations
- Increased default CodeDB write buffer size from 4MB to 16MB
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
PruningTrieStateFactory.cs |
Refactored to move config advice logic to MainPruningTrieStoreFactory and updated dependency injection |
RocksDbConfigFactory.cs |
New factory class implementing dynamic RocksDB configuration based on memory and pruning mode |
DbConfig.cs |
Added new configuration options for large memory and archive mode optimizations |
IRocksDbConfig.cs |
New interface abstracting RocksDB configuration properties |
HardwareInfo.cs |
New service providing system memory information using GC memory APIs |
| Test files | Updated to accommodate new factory pattern and dependency injection changes |
Comments suppressed due to low confidence (2)
| #endregion | ||
|
|
||
| #region read-write options | ||
| // TODO: These are not applied to column family |
There was a problem hiding this comment.
This TODO comment indicates incomplete functionality where options are not applied to column families. This should be addressed or properly documented with a plan for resolution.
src/Nethermind/Nethermind.Db.Rocks/Config/RocksDbConfigFactory.cs
Outdated
Show resolved
Hide resolved
Member
|
Please update with master |
2797111 to
c20f57a
Compare
Contributor
Author
|
Rebased |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Require #8997
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing